﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Net;
using System.Threading.Tasks;

namespace 客户端
{
    class Program
    {
        static void Main(string[] args)
        {
            Socket clientsocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            clientsocket.Connect(new IPEndPoint(new IPAddress(new byte[] { 192,168,230,1 }), 3785));

            byte[] data = new byte[1024];
            int length = clientsocket.Receive(data);
            string message = Encoding.UTF7.GetString(data, 0, length);
            Console.WriteLine("输入");
            for (int i = 0; i < 100; i++)
            {
                
                clientsocket.Send(Class1.getmessage(i.ToString()));
            }
            string str = "sdh|adjd|alks";
            //while (true)
            //{
            //  string mes = Console.ReadLine();
            //    if (mes=="Close")
            //    {
            //        clientsocket.Close();
            //        return;
            //    }
            //  clientsocket.Send(Encoding.UTF8.GetBytes(mes));
            //}
           
            clientsocket.Close();
            Console.ReadKey();
        }
        
    }
}
